package kr.co.ljw.empInfo.service;

import kr.co.ljw.emp.dao.EmpDao;
import kr.co.ljw.emp.bean.EmpBean;

import kr.co.ljw.dept.dao.DeptDao;

import java.util.ArrayList;
import java.util.List;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;


/**
 * 클래스설명 : EmpServiceImpl
 * @version : 2012. 5. 7.
 * @author : jw
 * @분류 : 
 * 설명 : 
 * SpringTdd / package kr.co.ljw.emp.service;
 */


@Service("EmpInfoService")
@SuppressWarnings({"rawtypes", "restriction"})

public class EmpInfoServiceImpl implements EmpInfoService {
	
	@Resource(name="EmpDao")
	private EmpDao empDao;
	
	@Resource(name="DeptDao")
	private DeptDao deptDao;
	
	
	//사원 부서이동 정보 조회
	@SuppressWarnings("unchecked")
	public List selectEmpInfo(EmpBean empBean){
		
		List empInfoList = new ArrayList();

		try {
			empInfoList.add(empDao.selectEmp(empBean));		//사원정보 저장
			empInfoList.add(deptDao.selectDepts());			//전체부서정보 저장
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return empInfoList;
	}

	
	@SuppressWarnings("unchecked")
	public List<List> selectEmpHistoryInfo(EmpBean empBean) {
		
		List empInfoList = new ArrayList();

		try {
			empInfoList.add(empDao.selectEmp(empBean));				//사원 현상태 정보
			empInfoList.add(empDao.selectEmpHistory(empBean));		//사원 히스토리 정보
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return empInfoList;
	}
}
